package com.hhkj.study.admin.user.service.biz.impl;

import cn.hutool.core.util.ObjectUtil;
import com.hhkj.study.admin.user.entity.UserFollow;
import com.hhkj.study.admin.user.model.podo.UserFollowDo;
import com.hhkj.study.admin.user.model.podo.UserFollowPo;
import com.hhkj.study.admin.user.model.req.UserFollowReq;
import com.hhkj.study.admin.user.model.res.UserFollowRes;
import com.hhkj.study.admin.user.service.base.UserFollowService;
import com.hhkj.study.admin.user.service.biz.UserFollowBizService;
import com.hhkj.study.admin.user.service.extend.UserFollowExtendService;
import com.ruoyi.common.base.biz.service.biz.BaseBizServiceImpl;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.stereotype.Service;

/**
* UserFollowBizServiceImpl
*
* @author SERVER
* @since 2024-09-06
*/
@Service
public class UserFollowBizServiceImpl extends BaseBizServiceImpl<UserFollow, UserFollowReq, UserFollowRes, UserFollowDo, UserFollowPo, UserFollowService, UserFollowExtendService> implements UserFollowBizService {

    @Override
    protected void beforeSave(UserFollowReq userFollowReq) {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        userFollowReq.setFollowUserId(ObjectUtil.isNull(loginUser.getUserId()) ? 0L : loginUser.getUserId());
    }
}